home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_qt.idb / usr / freeware / include / Qt / qmenubar.h.z / qmenubar.h
Encoding:
C/C++ Source or Header  |  1998-10-28  |  2.7 KB  |  104 lines

  1. /****************************************************************************
  2. ** $Id: qmenubar.h,v 2.12 1998/07/03 00:09:51 hanord Exp $
  3. **
  4. ** Definition of QMenuBar class
  5. **
  6. ** Created : 941209
  7. **
  8. ** Copyright (C) 1992-1998 Troll Tech AS.  All rights reserved.
  9. **
  10. ** This file is part of Qt Free Edition, version 1.40.
  11. **
  12. ** See the file LICENSE included in the distribution for the usage
  13. ** and distribution terms, or http://www.troll.no/free-license.html.
  14. **
  15. ** IMPORTANT NOTE: You may NOT copy this file or any part of it into
  16. ** your own programs or libraries.
  17. **
  18. ** Please see http://www.troll.no/pricing.html for information about 
  19. ** Qt Professional Edition, which is this same library but with a
  20. ** license which allows creation of commercial/proprietary software.
  21. **
  22. *****************************************************************************/
  23.  
  24. #ifndef QMENUBAR_H
  25. #define QMENUBAR_H
  26.  
  27. #ifndef QT_H
  28. #include "qpopupmenu.h"
  29. #endif // QT_H
  30.  
  31.  
  32. class QMenuBar : public QFrame, public QMenuData
  33. {
  34. friend class QPopupMenu;
  35.     Q_OBJECT
  36. public:
  37.     QMenuBar( QWidget *parent=0, const char *name=0 );
  38.    ~QMenuBar();
  39.  
  40.     void    updateItem( int id );
  41.  
  42.     void    show();                // reimplemented show
  43.     void    hide();                // reimplemented hide
  44.  
  45.     bool    eventFilter( QObject *, QEvent * );
  46.  
  47.     int        heightForWidth(int) const;
  48.  
  49.     enum    Separator { Never=0, InWindowsStyle=1 };
  50.     Separator     separator() const;
  51.     void    setSeparator( Separator when );
  52.  
  53. signals:
  54.     void    activated( int itemId );
  55.     void    highlighted( int itemId );
  56.  
  57. protected:
  58.     void    drawContents( QPainter * );
  59.     void    fontChange( const QFont & );
  60.     void    mousePressEvent( QMouseEvent * );
  61.     void    mouseReleaseEvent( QMouseEvent * );
  62.     void    mouseMoveEvent( QMouseEvent * );
  63.     void    keyPressEvent( QKeyEvent * );
  64.     void    resizeEvent( QResizeEvent * );
  65.     void    leaveEvent( QEvent * );
  66.     void    menuContentsChanged();
  67.     void    menuStateChanged();
  68.  
  69. private slots:
  70.     void    subActivated( int itemId );
  71.     void    subHighlighted( int itemId );
  72.     void    accelActivated( int itemId );
  73.     void    accelDestroyed();
  74.  
  75. private:
  76.     void    menuInsPopup( QPopupMenu * );
  77.     void    menuDelPopup( QPopupMenu * );
  78.     void    frameChanged();
  79.  
  80.     bool    tryMouseEvent( QPopupMenu *, QMouseEvent * );
  81.     void    tryKeyEvent( QPopupMenu *, QKeyEvent * );
  82.     void    goodbye();
  83.     void    openActPopup();
  84.     void    hidePopups();
  85.  
  86.     void    setActItem( int, bool );
  87.     void    setWindowsAltMode( bool, int = 0 );
  88.  
  89.     int        calculateRects( int max_width = -1 );
  90.     int        itemAtPos( const QPoint & );
  91.     QRect    itemRect( int item );
  92.  
  93.     void    setupAccelerators();
  94.     QAccel     *autoaccel;
  95.     QRect      *irects;
  96.  
  97. private:    // Disabled copy constructor and operator=
  98.     QMenuBar( const QMenuBar & );
  99.     QMenuBar &operator=( const QMenuBar & );
  100. };
  101.  
  102.  
  103. #endif // QMENUBAR_H
  104.